Notes/Domino 6 and 7 Forum

Notes/Domino 6 and 7 Forum





Appending inside sections not working
~Anita Bubnikonyoden 01/02/2004 07:08 PM
Applications Development 6.5; 6.0.2 CF2; 6.0.2 CF1; 6.0.2; 6.0.1 CF3; 6.0.1 CF2; 6.0.1 CF1; 6.0.1; 6.0 Windows 2000; Windows XP


Hello,

Using the new NotesRichTextNavigator class, get a bit of text inserted into a section.
Problem is that text gets inserted outside the section, almost as if the methods like FindFirstElement are not positioning the insertion point correctly.

Any help appreciated.

code snippet:

Set uidoc = workspace.CurrentDocument
Set doc = uidoc.Document
Set rti = doc.GetFirstItem("Body")
Set rtnav = rti.CreateNavigator

If rtnav.FindFirstElement(RTELEM_TYPE_SECTION) Then
Messagebox "Found Section in Body",, "Section"

Call rti.AddNewLine(1)
Call rti.AppendText("Appended Text after Find")
Call doc.Save(True, True)

Set rts = rtnav.GetElement
rts.IsExpanded = True

Call rti.AddNewLine(1)
Call rti.AppendText("Appended Text after expand")
Call doc.Save(True, True)

' This part fails "Element or Navigator is invalid"
' Call rtnav.SetPosition(rts)
' Call rti.AddNewLine(1)
' Call rti.AppendText("Appended Text after SetPosition")
' Call doc.Save(True, True)

' However, rts seems fine for this call
Call rtnav.SetPositionAtEnd(rts)
Call rti.AddNewLine(1)
Call rti.AppendText("Appended Text after SetPositionAtEnd")
Call doc.Save(True, True)

Else
'nothin

End If


Go back